﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="adminResourceClass.aspx.cs" Inherits="Admin_adminResourceClass" %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>
</head>
<body onload="$('#loading').hide()">
  <form id="form1" runat="server">
    <div class="container" id="cpcontainer">
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div> 
    
    
    <ul id="makeHtmlTab">
<li class="hover"><a href="javascript:void(0)" onclick="">资源分类</a>
        &nbsp;&nbsp;&nbsp;
    </li>
        </ul>
    <table class="tb" id="TABLE1" onclick="">
    <tr><td colspan="3"><INPUT id="Button1" class="btn" onclick="javascript:location.href=location.href;" type=button value="添  加" /></td></tr>
        <tr>
			<td align="left" style="width: 205px;">
                资源类别名称(resourceClassName)</td>
            <td style="width: 204px; height: 17px">
                资源类别类型</td>
			<td  style="height: 17px; width: 230px;">&nbsp;操作（编辑资源类别，删除资源类别）</td>		
        </tr>
        
       
        <asp:Repeater ID="Repeater1" runat="server">     
      <ItemTemplate>      
    <tr bgcolor="#f5fafe" >
	<td ><a href='adminResource.aspx?ClassId=<%#Eval("resourceClassID") %>'><%#Eval("resourceClassID") %><%#Eval("resourceClassName") %></a>
	(<font color="red"><%#countByClass(Convert.ToInt32(Eval("resourceClassID"))) %></font>)
	</td>
	<td ><%#Eval("type") %></td>	
	<td>
	  <input id="Button5" type="button" value="编辑" class='btn' title='<%#Eval("resourceClassID") %>' onclick="$('#loading').show();ajax_get(convertURL('adminResourceClass.aspx?state=edit&resourceClassID='+this.title),'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide();});"/>
	   <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("resourceClassID") %>' onclick="if(confirm('确定要删除吗')){$('#loading').show();ajax_get(convertURL('adminResourceClass.aspx?state=del&resourceClassID='+this.title),'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide();});}else{return false}"/>			
	</td>
  </tr>   
      </ItemTemplate>  
      </asp:Repeater>              
       
        </table>
        <br />
<ul id="makeHtmlTab2"><li class="hover"><a href="javascript:void(0)" >添加/编辑资源分类</a> &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp;
</li>
    &nbsp;
        </ul>
    <table class="tb" id="addRole">
    <tr class="thead"><th colspan="8">
        </th></tr>	
        <tr align="center">
            <td style="width: 308px" >
                资源类别名称：
            </td>
            <td style="width: 290px">
                <input id="txt_resourceClassName" style="width: 100px" type="text" name="txt_resourceClassName1" value="" runat="server" /><span style="color: #ff0000">＊</span></td>
            <td align="center" style="width: 188px">
                资源类别类型：</td>
            <td align="left" colspan="2" style="width: 1175px">
                <span style="color: #ff0000">
                    <%=typeDp("typeDp",10)%>
                </span></td>
    </tr>
        <tr align="center">
            <td align="center" colspan="6">          
                <input id="InsertResourceClass" class="btn" onclick="add()" type="button" value="确认保存" />
               </td>
        </tr>
</table>
<input id="resourceClass_hid" runat="server" type="hidden" value="0" name="resourceClass_hid" />
</div>      
      <uc1:adminfoot ID="Adminfoot1" runat="server" />
</form>
<script type="text/javascript">
    function add()
    {        
        $("#loading").show();
        var Param="";
        var url="";
        if($("#txt_resourceClassName").attr("value")!="")
        {        
           
            if($("#resourceClass_hid").attr("value")!="0")
             {
                url=convertURL("adminResourceClass.aspx?state=update&resourceClassID="+$("#resourceClass_hid").attr("value")); 
                Param+="&resourceClassName="+$("#txt_resourceClassName").attr("value")+"&type="+$("#typeDp option:selected").attr("value");            
                ajax_post(url,Param,function(msg){   
                 $("#cpcontainer").empty().append(msg); 
                 $("#loading").hide();               
                });                        
             }
             else
             {
                 url=convertURL("adminResourceClass.aspx?state=add&resourceClassID="+$("#resourceClass_hid").attr("value")); 
                 Param+="&resourceClassName="+$("#txt_resourceClassName").attr("value")+"&type="+$("#typeDp option:selected").attr("value");            
                ajax_post(url,Param,function(msg){
                    $("#cpcontainer").empty().append(msg);
                    $("#loading").hide();       
                }); 
                        
             }
        } 
        else
        {
            alert("资源类别名不能为空！");
            $("#loading").hide();       
            return false;
        }
    } 
</script>
<script type="text/javascript">
function GivePower(tg,title)
{
   var  el=$(tg).prev()[0];
   _1=el;openWindow2(20,420,400,0);
	var msgDiv=document.getElementById("msg");
	var _t = tg.offsetTop;
    var _l = tg.offsetLeft;
    while (tg = tg.offsetParent){_t+=tg.offsetTop; _l+=tg.offsetLeft;}
    msgDiv.style.cssText+="border:1px solid #55BBFF;background: #C1E7FF;padding:1px 0px 1px 1px;height: auto;"
	msgDiv.style.top = (_t-1)+"px";
    msgDiv.style.left = (_l-1)+"px";
	msgDiv.innerHTML='<button type="button" class="btn" style="margin:0 6px 0 0;height:23px;float:right;padding:0;" onclick="closeWin()">关闭</button><iframe src="FileDownLoad/selectRole.aspx?roleId='+title+'" scrolling="no" topmargin="0"  height:auto;overflow:auto;  marginwidth="0" marginheight="0" frameborder="0" align="center"  onload="this.height=this.contentWindow.document.documentElement.scrollHeight"></iframe>';
}
</script>

</body>
</html>
